<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Результаты поиска вакансий</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h1 class="mb-4">Результаты поиска вакансий</h1>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>Название</th>
            <th>Город</th>
            <th>Компания</th>
            <th>Зарплата</th>
            <th>Опыт</th>
            <th>Требования</th>
            <th>Обязанности</th>
            <th>Ссылка</th>
        </tr>
        </thead>
        <tbody>
        @foreach($vacancies as $vacancy)
            <tr>
                <td>{{ $vacancy['name'] }}</td>
                <td>{{ $vacancy['area']['name'] }}</td>
                <td>{{ $vacancy['employer']['name'] }}</td>
                <td>
                    @if($vacancy['salary'])
                        {{ $vacancy['salary']['from'] ?? 'не указана' }} - {{ $vacancy['salary']['to'] ?? 'не указана' }} {{ $vacancy['salary']['currency'] }}
                    @else
                        не указана
                    @endif
                </td>
                <td>{{ $vacancy['experience']['name'] }}</td>
                <td>{{ $vacancy['snippet']['requirement'] ?? 'не указаны' }}</td>
                <td>{{ $vacancy['snippet']['responsibility'] ?? 'не указаны' }}</td>
                <td><a href="{{ $vacancy['alternate_url'] }}" target="_blank">Откликнуться</a></td>
            </tr>
        @endforeach
        </tbody>
    </table>
</div>
</body>
</html>
